﻿using System;
using System.Linq;
using Bots.DungeonBuddy.Helpers;
using CommonBehaviors.Actions;
using FarmerJoe.Helpers;
using FarmerJoe.Helpers.Logging;
using FarmerJoe.Helpers.Singular.Helpers;
using FarmerJoe.Helpers.Units;
using FarmerJoe.Settings;
using Styx;
using Styx.CommonBot;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Action = Styx.TreeSharp.Action;

namespace FarmerJoe.Classes
{
    public static partial class Hunter
    {

        public static Composite CombatBehavior_Marks
        {
            get
            {
                return new PrioritySelector(

                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),

                    // Healing
                    Common.UseHealthManaRegenAgent(ClassParser.HealthPotion, 0),

                    Inventory.UseTrinket1(),
                    Inventory.UseTrinket2(),

                    Movement.MoveToLOS(),
                    Movement.FaceTarget(),
                    Movement.Fixes(),




                    new Decorator(ret => Me.IsCasting || Me.IsChanneling, new Action(context => RunStatus.Success)),

                    Movement.MoveToTarget(true, 36f)
                    );
            }
        }

        public static Composite PullBehavior_Marks
        {
            get
            {
                return new PrioritySelector(

                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),
                    Movement.MoveToLOS(),
                    Movement.FaceTarget(),
                    new Sequence(ret => Me.Mounted, new Action(ret => Spells.Dismount("Pulling")), new Action(ctx => RunStatus.Failure)),

                    Movement.Fixes(),

                    new Decorator(ret => FpswareSettings.Instance.Hunter.MarksPull.Contains("user defined"),
                                  new PrioritySelector(
                                      )),


                    new Decorator(ret => FpswareSettings.Instance.Hunter.MarksPull.Contains("automatic"),
                                  new PrioritySelector(
                                      )),


                    new Decorator(ret => Me.IsCasting || Me.IsChanneling, new Action(context => RunStatus.Success)),
                    Movement.MoveToTarget(true, 35f)
                    );
            }
        }

    }
}